package com.scalar.chiptrack.sales.forms;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.util.ArrayList;

import org.apache.struts.action.Action;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionError;
import org.apache.struts.action.ActionErrors;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForward;

import com.scalar.chiptrack.ChipTrackActionForm;
import com.scalar.chiptrack.commons.Address;
import com.scalar.chiptrack.sales.SalesOrder;
import com.scalar.chiptrack.utils.StringUtils;

/**
 * Form bean for the sales_order page.  This form has the following fields,
 * with default values in square brackets:
 * <ul>
 * <li><b>action</b> - The maintenance action we are performing (Create. Modify & Save).
 * </ul>
 *
 * @author Kesava Kumar Achanala
 * @version $Revision: 1.11 $ $Date: 2010/07/22 17:47:07 $
 * Modified by Raj Vallamsetla $Date 2003/01/17 12:11:00 $
 */

public class SalesOrderForm extends ChipTrackActionForm {

    // --------------------------------------------------- Instance Variables
    private String action = null;

    private int salesOrderId = -1;
	private String salesOrderNo = null;
    private int customerId = -1;
    private String customerName = null;
    private String customerPo = null;
    private String contactPerson = null;
    private String salesPerson = null;
    private String phoneNumber = null;
    private String faxNumber = null;
    private String email = null;
    private String endUser = null;
    private String shippingMethod = null;
    private String shippingAccount = null;
    private ArrayList shippingMethods = null;
    private ArrayList shippingAddresses = null;
    private ArrayList billingAddresses = null;
    private int billingAddressId = -1;
    private String billingAddress = null;
    private int shippingAddressId = -1;
    private String shippingAddress = null;
    private String comments = null;
    private String shippingInstructions = null;
    private boolean isCancel = false;
    private String status = null;
    private boolean isSample = false;
    private String enteredBy = null;
    private int alaramId = -1;
    private String shippingMethodName = null;
    private String reason = null;
    private String salesOrderDate = null;
    private String newshippingAccount = null;
    private String newshippingMethod = null;
	private String cellNumber = null;
	private ArrayList contactPersons = null;
    private ArrayList  contactPersonsForBillingAddress = null;  //Added by Veeru  on 24th April 2004
    private ArrayList  contactPersonsForShippingAddress = null; //Added by Veeru  on 24th April 2004

    private String billingContactPerson = null; //Added by Veeru  on 25th April 2004
    private String shippingContactPerson = null; //Added by Veeru  on 25th April 2004

	private String address = null;

    private String endUserId = null;
    private String salesRep = null;

    // Added by Veeru on 18th Nov 2004
    private String poRev  = null;
    private String poDate = null;

    private String odm = null;
    private int odmId = -1;
    private boolean isEndCustomerShipAddress = false;
    private int shippingInstructionsId = -1;

    private String freightInstructions = null;
    private int freightInstructionsId = -1;
    private ArrayList allDeliveryTerms = null;
    private String letterOfCreditNo = null;
    private String lcIssuingBank    = null;
    private int quotationId         = -1;
    private String quotationNo      = null;
    private int endCustomerId       = -1;
    private String endCustomer      = null;
    private boolean isConsignee;
    private String isConsignmentSales; //0 - true, 1 - false, null need to select in JSP
    private String newEndUserName;
    private String newEndCustomerName;
    private String userField1;
    private String userField2;


    // ----------------------------------------------------------- Properties

    public int getSalesOrderId()
    {
        return salesOrderId;
    }

    public void setSalesOrderId(int salesOrderId)
    {
        this.salesOrderId = salesOrderId;
    }

	public String getSalesOrderNo()
    {
        return salesOrderNo;
    }

    public void setSalesOrderNo(String salesOrderNo)
    {
        this.salesOrderNo = salesOrderNo;
    }

    public int getCustomerId()
    {
        return customerId;
    }

    public void setCustomerId(int customerId)
    {
        this.customerId = customerId;
    }

    public String getCustomerName()
    {
        return customerName;
    }

    public void setCustomerName(String customerName)
    {
        this.customerName = customerName;
    }

    public String getCustomerPO()
    {
        return customerPo;
    }

    public void setCustomerPO(String customerPo)
    {
        this.customerPo = customerPo;
    }

    public String getContactPerson()
    {
        return contactPerson;
    }

    public void setContactPerson(String contactPerson)
    {
        this.contactPerson = contactPerson;
    }

	public String getCellNumber()
    {
	   return cellNumber;
    }
	//Added by Sarada on 5th March 2004
    public void setCellNumber(String cellNumber)
    {
	   this.cellNumber = cellNumber;
    }
    public String getSalesPerson()
    {
        return salesPerson;
    }
    public String getSalesRep()
    {
        return salesRep;
    }

	public String getAddress()
	{
	   if(address == null)
	   address = "";
	   return address;
	}

	public void setAddress(String address)
	{
	   this.address = address;
	}

    public void setSalesPerson(String salesPerson)
    {
        this.salesPerson = salesPerson;
    }
    public void setSalesRep(String salesRep)
    {
        this.salesRep = salesRep;
    }

    public String getPhoneNumber()
    {
        return phoneNumber;
    }

    public void setPhoneNumber(String phoneNumber)
    {
        this.phoneNumber = phoneNumber;
    }

    public String getFaxNumber()
    {
        return faxNumber;
    }

    public void setFaxNumber(String faxNumber)
    {
        this.faxNumber = faxNumber;
    }

    public String getEmail()
    {
        return email;
    }

    public void setEmail(String email)
    {
        this.email = email;
    }

    public String getEndUser()
    {
        return endUser;
    }

    public void setEndUser(String endUser)
    {
        this.endUser = endUser;
    }


    public String getShippingAccount()
    {
        return shippingAccount;
    }

    public void setShippingAccount(String shippingAccount)
    {
        this.shippingAccount = shippingAccount;
    }

    public String getShippingMethod()
    {
	  return shippingMethod;
    }

    public void setShippingMethod(String shippingMethod)
    {
        this.shippingMethod = shippingMethod;
    }
    //Added by Sarada to set properties to new ShippingMethod and Account
    public String getNewshippingAccount()
    {
        return newshippingAccount;
    }

    public void setNewshippingAccount(String newshippingAccount)
    {
        this.newshippingAccount = newshippingAccount;
    }

    public String getNewshippingMethod()
    {
        return newshippingMethod;
    }

    public void setNewshippingMethod(String newshippingMethod)
    {
        this.newshippingMethod = newshippingMethod;
    }

    public ArrayList getShippingMethods()
    {
        return shippingMethods;
    }

    public void setShippingMethods(ArrayList shippingMethods)
    {
        this.shippingMethods = shippingMethods;
    }
	//	Added by Sarada on 5th March 2004
	public ArrayList getContactPersons()
	{
	   return contactPersons;
	}

	public void setContactPersons(ArrayList contactPersons)
	{
	   this.contactPersons = contactPersons;
	}
    //Added by Veeru  on 24th April 2004
    public ArrayList getContactPersonsForBillingAddress() {
        return contactPersonsForBillingAddress;
    }

    public void setContactPersonsForBillingAddress(ArrayList contactPersonsForBillingAddress) {
        this.contactPersonsForBillingAddress = contactPersonsForBillingAddress;
    }

    public ArrayList getContactPersonsForShippingAddress() {
        return contactPersonsForShippingAddress;
    }

    public void setContactPersonsForShippingAddress(ArrayList contactPersonsForShippingAddress) {
        this.contactPersonsForShippingAddress = contactPersonsForShippingAddress;
    }
    public String getBillingContactPerson() {
        return billingContactPerson;
    }

    public void setBillingContactPerson(String billingContactPerson) {
        this.billingContactPerson = billingContactPerson;
    }

    public String getShippingContactPerson() {
        return shippingContactPerson;
    }

    public void setShippingContactPerson(String shippingContactPerson) {
        this.shippingContactPerson = shippingContactPerson;
    }
    // End of Added by veeru

    public void addShippingAccountAndMethod (Object shippingAccountAndMethod)
	{
		if (this.shippingMethods == null) {
			this.shippingMethods = new ArrayList();
		}

		this.shippingMethods.add (shippingAccountAndMethod);
    }

    public ArrayList getShippingAddresses()
    {
        return shippingAddresses;
    }

    public void setShippingAddresses(ArrayList shippingAddresses)
    {
        this.shippingAddresses = shippingAddresses;
    }

    public int getBillingAddressId()
    {
        return billingAddressId;
    }

    public void setBillingAddressId(int billingAddressId)
    {
        this.billingAddressId = billingAddressId;
    }

    public String getBillingAddress()
    {
        return billingAddress;
    }

    public void setBillingAddress(String billingAddress)
    {
        this.billingAddress = billingAddress;
    }

    public int getShippingAddressId()
    {
        return shippingAddressId;
    }

    public void setShippingAddressId(int shippingAddressId)
    {
        this.shippingAddressId = shippingAddressId;
    }

    public String getShippingAddress()
    {
        return shippingAddress;
    }

    public void setShippingAddress(String shippingAddress)
    {
        this.shippingAddress = shippingAddress;
    }

    //For Address Object
    //Added by Prabhanjan on 05 Feb 2004
    private Address billingAddressAsObject = new Address();
    private Address shippingAddressAsObject = new Address();

    public Address getBillingAddressAsObject ()
    {
        return billingAddressAsObject;
    }

    public void setBillingAddressAsObject ( Address billingAddressAsObject )
    {
        this.billingAddressAsObject = billingAddressAsObject;
    }

    public Address getShippingAddressAsObject ()
    {
        return shippingAddressAsObject;
    }

    public void setShippingAddressAsObject ( Address shippingAddressAsObject )
    {
        this.shippingAddressAsObject = shippingAddressAsObject;
    }

    public String getComments()
    {
        return comments;
    }

    public void setComments(String comments)
    {
        this.comments = comments;
    }

    public String getShippingInstructions()
    {
        return shippingInstructions;
    }

    public void setShippingInstructions(String shippingInstructions)
    {
        this.shippingInstructions = shippingInstructions;
    }

    public boolean isCancel()
    {
        return isCancel;
    }

    public void setIsCancel(boolean isCancel)
    {
        this.isCancel = isCancel;
    }

    public String getStatus()
    {
        return status;
    }

    public void setStatus(String status)
    {
        this.status = status;
    }

    public boolean getIsSample()
    {
        return isSample;
    }

    public void setIsSample(boolean isSample)
    {
        this.isSample = isSample;
    }

    public int getAlaramId()
    {
        return alaramId;
    }

    public void setAlaramId(int alaramId)
    {
        this.alaramId = alaramId;
    }



    public String getAction()
    {
        return action;
    }

    public void setAction(String action)
    {
        this.action = action;
    }

    //For change order
    private int changeNo;
    public int getChangeNo()
    {
        if( changeNo == 0)
            changeNo = 1;
        return changeNo;
    }

    public void setChangeNo(int changeNo)
    {
        this.changeNo = changeNo;
    }

    public String getReason()
    {
        return reason;
    }

    public void setReason(String reason)
    {
        this.reason = reason;
    }

    private boolean financeHold = false;
    private String financeHoldUser = null;
    private boolean operationsHold = false;
    private String operationsHoldUser = null;
    private boolean marketingHold = false;
    private String marketingHoldUser = null;
    private boolean salesHold = false;
    private String salesHoldUser = null;

    public boolean getFinanceHold()
   {
       return financeHold;
   }

   public void setFinanceHold(boolean financeHold)
   {
       this.financeHold = financeHold;
   }

   public boolean getOperationsHold()
   {
       return operationsHold;
   }

   public void setOperationsHold(boolean operationsHold)
   {
       this.operationsHold = operationsHold;
   }

   public boolean getMarketingHold()
   {
       return marketingHold;
   }

   public void setMarketingHold(boolean marketingHold)
   {
       this.marketingHold = marketingHold;
   }

   public boolean getSalesHold()
   {
       return salesHold;
   }

   public void setSalesHold(boolean salesHold)
   {
       this.salesHold = salesHold;
   }

   public String getFinanceHoldUser()
   {
       return financeHoldUser;
   }

   public void setFinanceHoldUser(String financeHoldUser)
   {
       this.financeHoldUser = financeHoldUser;
   }

   public String getOperationsHoldUser()
   {
       return operationsHoldUser;
   }

   public void setOperationsHoldUser(String operationsHoldUser)
   {
       this.operationsHoldUser = operationsHoldUser;
   }

   public String getMarketingHoldUser()
   {
       return marketingHoldUser;
   }

   public void setMarketingHoldUser(String marketingHoldUser)
   {
       this.marketingHoldUser = marketingHoldUser;
   }

   public String getSalesHoldUser()
   {
       return salesHoldUser;
   }

   public void setSalesHoldUser(String salesHoldUser)
   {
       this.salesHoldUser = salesHoldUser;
   }

    public String getShippingMethodName()
    {

/*	    int index1 = 0;
        String shippingMethodName1 = "";
        String shippingMethodName2 = "";

	    if(shippingMethodName !=  null)
        {
             //System.out.println("shippingMethodName in form "+shippingMethodName+"DD"+shippingMethodName.length());
            index1 = shippingMethodName.indexOf("-");

            if( index1 != -1 && index1 != 0)
            {
                shippingMethodName1 = shippingMethodName.substring(0,index1).trim();
                shippingMethodName2 = shippingMethodName.substring(index1+1,shippingMethodName.length()).trim();
                System.out.println("shippingMethodName2:"+shippingMethodName2);
                shippingMethodName = shippingMethodName1+"   -   "+shippingMethodName2;
            }

        }
        */
        return shippingMethodName;
    }

    public void setShippingMethodName(String shippingMethodName)
    {
        this.shippingMethodName = shippingMethodName;
    }


    private static int totalQty;
    private static float totalAmount;
    public String getTotalQty()
    {
        return StringUtils.formatUnits(totalQty);
    }
    public void setTotalQty(int totalQty)
    {
        this.totalQty = totalQty;
    }
    public String getTotalAmount()
    {
        return StringUtils.formatAmountWithNoOfDecimals(totalAmount);
    }
    public void setTotalAmount(float totalAmount)
    {
        this.totalAmount = totalAmount;
    }

    //For taxes
    private String salesTaxType = null;
    private float subTotal = 0.0f;
    private float salesTax = 0.0f;
    private float frieght = 0.0f;
    private float misc = 0.0f;
    private float orderTotal = 0.0f;

    public String getSalesTaxType()
    {
        return salesTaxType;
    }
    public void setSalesTaxType(String salesTaxType)
    {
        this.salesTaxType = salesTaxType;
    }

    public float getSubTotal()
    {
        return subTotal;
    }
    public String getSubTotalAsString()
    {
		//return StringUtils.formatAmount(subTotal,"$###,###.##");
		return StringUtils.formatAmountWithNoOfDecimals(subTotalAsDouble);
    }
    public void setSubTotal(float subTotal)
    {
        this.subTotal = subTotal;
    }

    public float getSalesTax()
    {
        return salesTax;
    }
    public String getSalesTaxAsString()
    {
		//return StringUtils.formatAmount(salesTax,"$###,###.##");
		 return StringUtils.formatAmountWithNoOfDecimals(salesTaxAsDouble);
    }
    public void setSalesTax(float salesTax)
    {
        this.salesTax = salesTax;
    }

    public String getFrieghtAsString()
    {
		//return StringUtils.formatAmount(frieght,"$###,###.##");
	   return StringUtils.formatAmountWithNoOfDecimals(frieghtAsDouble);
    }
    public float getFrieght()
    {
        return frieght;
    }
    public void setFrieght(float frieght)
    {
        this.frieght = frieght;
    }

    public String getMiscAsString()
    {
		// return StringUtils.formatAmount(misc,"$###,###.##");
		return StringUtils.formatAmountWithNoOfDecimals(miscAsDouble);
    }
    public float getMisc()
    {
        return misc;
    }
    public void setMisc(float misc)
    {
        this.misc = misc;
    }

    public float getOrderTotal()
    {
        return orderTotal;
    }
    public String getOrderTotalAsString()
    {
		//return StringUtils.formatAmount(orderTotal,"$###,###.##");
	   return StringUtils.formatAmountWithNoOfDecimals(orderTotalAsDouble);
    }
    public void setOrderTotal(float orderTotal)
    {
        this.orderTotal = orderTotal;
    }

	//	Added by Sarada on 1st April 2004
	  double subTotalAsDouble   = 0.0;
	  double salesTaxAsDouble   = 0.0;
	  double frieghtAsDouble    = 0.0;
	  double miscAsDouble       = 0.0;
	  double orderTotalAsDouble = 0.0;

	 public double getSubTotalAsDouble()
	 {
		 return subTotalAsDouble;
	 }

	 public void setSubTotalAsDouble(double subTotalAsDouble)
	 {
		 this.subTotalAsDouble = subTotalAsDouble;
	 }

	 public double getSalesTaxAsDouble()
	 {
		return salesTaxAsDouble;
	 }

	 public void setSalesTaxAsDouble(double salesTaxAsDouble)
	 {
		this.salesTaxAsDouble = salesTaxAsDouble;
	 }

	 public double getFrieghtAsDouble()
	 {
	   return frieghtAsDouble;
	 }
	 public void setFrieghtAsDouble(double frieghtAsDouble)
	 {
	   this.frieghtAsDouble = frieghtAsDouble;
	 }

	 public double getMiscAsDouble()
	 {
		 return miscAsDouble;
	 }
	 public void setMiscAsDouble(double miscAsDouble)
	 {
		 this.miscAsDouble = miscAsDouble;
	 }

	 public double getOrderTotalAsDouble()
	 {
		 return orderTotalAsDouble;
	 }
	 public void setOrderTotalAsDouble(double orderTotalAsDouble)
	 {
		 this.orderTotalAsDouble = orderTotalAsDouble;
	 }

	 //Modifications ends here


    //Added by kumar 02/10/03 for brecis
    private String regionalRep = null;
    private String shippingTerms = null;
    private String deliveryTerms = null;
    private String newsalesstate = null;
	private String newsalestax = null;
	private String newShippingTerms = null;
	private ArrayList allShippingTerms = null;
    private String newDeliveryTerms = null;


    public String getRegionalRep()
    {
        return regionalRep;
    }
    public void setRegionalRep(String regionalRep)
    {
        this.regionalRep = regionalRep;
    }

    public String getShippingTerms()
    {
        return shippingTerms;
    }
    public void setShippingTerms(String shippingTerms)
    {
        this.shippingTerms = shippingTerms;
    }
 	//Added by Sarada on 20th March 2004
 	public ArrayList getAllShippingTerms()
 	{
			return allShippingTerms;
	}
	public void setAllShippingTerms(ArrayList list)
	{
		allShippingTerms = list;
	}

	public String getNewShippingTerms()
	{
		return newShippingTerms;
	}
	public void setNewShippingTerms(String newShippingTerms)
	{
		this.newShippingTerms = newShippingTerms;
	}



    public String getDeliveryTerms()
    {
        return deliveryTerms;
    }
    public void setDeliveryTerms(String deliveryTerms)
    {
        this.deliveryTerms = deliveryTerms;
    }


    public String getSalesOrderDate()
    {
        if(salesOrderDate == null)
            return StringUtils.formatDateToString(new java.util.Date(System.currentTimeMillis()), "MM/dd/yyyy");
        else
            return salesOrderDate;
    }

    public void setSalesOrderDate(String salesOrderDate)
    {
        this.salesOrderDate = salesOrderDate;
    }


    private String miscName = "Misc";
	//private String miscName = "";
    public String getMiscName()
    {
        return miscName;
    }
    public void setMiscName(String miscName)
    {
        this.miscName = miscName;
    }

    private String newShippingMethod = null;
    public String getNewShippingMethod()
    {
        return newShippingMethod;
    }
    public void setNewShippingMethod(String newShippingMethod)
    {
        this.newShippingMethod = newShippingMethod;
    }
    public String getNewSalesState()
    {
        return newsalesstate;
    }
    public void setNewSalesState(String newsalesstate)
    {
        this.newsalesstate = newsalesstate;
    }
    public String getNewSalesTax()
    {
        return newsalestax;
    }
    public void setNewSalesTax(String newsalestax)
    {
        this.newsalestax = newsalestax;
    }

    public String getEndUserId ()
    {
        return endUserId;
    }

    public void setEndUserId ( String endUserId )
    {
        this.endUserId = endUserId;
    }

    public String getPoRev() {
                    return poRev;
    }

    public void setPoRev(String poRev) {
        this.poRev = poRev;
    }

    public String getPoDate() {
            return poDate;
    }

    public void setPoDate(String poDate) {
        this.poDate = poDate;
    }

    public int getOdmId() {
        return odmId;
    }

    public void setOdmId(int odmId) {
        this.odmId = odmId;
    }

    public String getOdm() {
        return odm;
    }

    public void setOdm(String odm) {
        this.odm = odm;
    }

    public boolean getIsEndCustomerShipAddress() {
        return isEndCustomerShipAddress;
    }

    public void setIsEndCustomerShipAddress(boolean endCustomerShippingAddress) {
        this.isEndCustomerShipAddress = endCustomerShippingAddress;
    }

    public int getShippingInstructionsId() {
        return shippingInstructionsId;
    }

    public void setShippingInstructionsId(int shippingInstructionsId) {
        this.shippingInstructionsId = shippingInstructionsId;
    }

    public ArrayList getAllDeliveryTerms() {
        return allDeliveryTerms;
    }

    public void setAllDeliveryTerms(ArrayList allDeliveryTerms) {
        this.allDeliveryTerms = allDeliveryTerms;
    }

    public String getNewDeliveryTerms() {
        return newDeliveryTerms;
    }

    public void setNewDeliveryTerms(String newDeliveryTerms) {
        this.newDeliveryTerms = newDeliveryTerms;
    }

    // Added by Prabhanjan on 5 Feb 2004
    private String billingAddressAsHTML="";
    public String getBillingAddressAsHTML()
    {
        StringBuffer tempAddress=new StringBuffer("");
        for(int i=0;i<billingAddress.length();i++)
        {
            char ch = billingAddress.charAt(i);
            if(ch=='\n')
            {
                tempAddress.append("<br>");
            }
            else
            {
                tempAddress.append(ch);
            }
        }
        billingAddressAsHTML = tempAddress.toString();
        return billingAddressAsHTML;
    }

    // Added by Prabhanjan on 5 Feb 2004
    private String shippingAddressAsHTML="";
    public String getShippingAddressAsHTML()
    {
        StringBuffer tempAddress=new StringBuffer("");
        if ( shippingAddress != null )
        {
            for(int i=0;i<shippingAddress.length();i++)
            {
                char ch = shippingAddress.charAt(i);
                if(ch=='\n')
                {
                    tempAddress.append("<br>");
                }
                else
                {
                    tempAddress.append(ch);
                }
            }
        }
        shippingAddressAsHTML = tempAddress.toString();
        return shippingAddressAsHTML;
    }

  //Added by Sarada on 14th March 2004
	public static String getAddressAsString(Address address)
	{
		StringBuffer tempAddress =   new StringBuffer("");
		String contactPerson = address.getContactPerson();
		String address1 = address.getAddress1();
		String address2 = address.getAddress2();
		String address3 = address.getAddress3();
		String address4 = address.getAddress4();
		String city = address.getCity();
		String zipCode= address.getZipCode();
		String state = address.getState();
		String country = address.getCountry();

		if(contactPerson!=null && !(contactPerson.trim().equals("")))
		{
			tempAddress.append(contactPerson+"\n");
		}
		if(address1!=null && !(address1.trim().equals("")))
		{
			tempAddress.append(address1+"\n");
		}
		if(address2!=null && !(address2.equals("")))
		{
			tempAddress.append(address2+"\n");
		}
		//Added by Sarada on 16th March2004
		if(address3!=null && !(address3.equals("")))
		{
		   tempAddress.append(address3+"\n");
		}
		if(address4!=null && !(address4.equals("")))
		{
		   tempAddress.append(address4+"\n");
		}
		if(city!=null && !(city.equals("")))
		{
			tempAddress.append(city+"\n");
		}
		if(state!=null && !(state.equals("")))
		{
			tempAddress.append(state);
		}


		if(zipCode!=null && !(zipCode.equals("")))
		{
			if(state!=null && !(state.equals("")))
			{
				tempAddress.append(", ");
			}
			tempAddress.append(zipCode);
		}

		if(country!=null && !(country.equals("")))
		{
			if((zipCode!=null && !(zipCode.equals("")))||(state!=null && !(state.equals(""))))
			{
				tempAddress.append(", ");
			}
			tempAddress.append(country);
		}
		return tempAddress.toString();
	}



    /*
    //From here.. these values need to get from logic:iterate tag, but it is returning null I am
    //doing like this. this code needs to replace from here to till here caption
    private int lineItem;
    public String[] getLineItem() {
        return lineItem;
    }
    public void setLineItem(String[] lineItem){
        this.lineItem = lineItem;
    }
    private String[] marketingPartNo;
    public String[] getMarketingPartNo(){
        return marketingPartNo;
    }
    public void setMarketingPartNo(String[] marketingPartNo){
        this.marketingPartNo = marketingPartNo;
    }
    private String[] manufacturingPartNo;
    public String[] getManufacturingPartNo(){
        return manufacturingPartNo;
    }
    public void setManufacturingPartNo(String[] manufacturingPartNo){
        this.manufacturingPartNo = manufacturingPartNo;
    }
    private String[] quantity;
    public String[] getQuantity(){
        return quantity;
    }
    public void setQuantity(String[] quantity){
        this.quantity = quantity;
    }
    private String[] requestDate;
    public String[] getRequestDate(){
        return requestDate;
    }
    public void setRequestDate(String[] requestDate){
        this.requestDate = requestDate;
    }
    private String[] unitPrice;
    public String[] getUnitPrice(){
        return unitPrice;
    }
    public void setUnitPrice(String[] unitPrice){
        this.unitPrice = unitPrice;
    }
    private String[] amount;
    public String[] getAmount(){
        return amount;
    }
    public void setAmount(String[] amount){
        this.amount = amount;
    }
    */

    // --------------------------------------------------------- Public Methods


    /**
     * Reset all properties to their default values.
     *
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     */
    public void reset(ActionMapping mapping, HttpServletRequest request) {

		//.....
        isEndCustomerShipAddress = false;

    }


    /**
     * Validate the properties that have been set from this HTTP request,
     * and return an <code>ActionErrors</code> object that encapsulates any
     * validation errors that have been found.  If no errors are found, return
     * <code>null</code> or an <code>ActionErrors</code> object with no
     * recorded error messages.
     *
     * @param mapping The mapping used to select this instance
     * @param request The servlet request we are processing
     */
    public ActionErrors validate(ActionMapping mapping,
                                 HttpServletRequest request) {

        ActionErrors errors = new ActionErrors();

        //if ((vendorName == null) || (vendorName.length() < 1))
        //    errors.add("Vendor", new ActionError("error.vendor name.required"));

        return errors;

    }

    //Added by Sujan on 11th jan 2005.
    public String getFreightInstructions()
    {
        return freightInstructions;
    }

    public void setFreightInstructions( String freightInstructions )
    {
        this.freightInstructions = freightInstructions;
    }

    //added by Sujan on 17th Jan 2005.
    public int getFreightInstructionsId()
    {
        return freightInstructionsId;
    }

    public void setFreightInstructionsId( int freightInstructionsId )
    {
        this.freightInstructionsId = freightInstructionsId;
    }

    public String getLetterOfCreditNo() {
        return letterOfCreditNo;
    }

    public void setLetterOfCreditNo(String letterOfCreditNo) {
        this.letterOfCreditNo = letterOfCreditNo;
    }

    public String getLcIssuingBank() {
        return lcIssuingBank;
    }

    public void setLcIssuingBank(String lcIssuingBank) {
        this.lcIssuingBank = lcIssuingBank;
    }

    public int getQuotationId() {
        return quotationId;
    }

    public void setQuotationId(int quotationId) {
        this.quotationId = quotationId;
    }

    public String getQuotationNo() {
        return quotationNo;
    }

    public void setQuotationNo(String quotationNo) {
        this.quotationNo = quotationNo;
    }

    public String getEndCustomer() {
        return endCustomer;
    }

    public void setEndCustomer(String endCustomer) {
        this.endCustomer = endCustomer;
    }

    public int getEndCustomerId() {
        return endCustomerId;
    }

    public void setEndCustomerId(int endCustomerId) {
        this.endCustomerId = endCustomerId;
    }

    public boolean getIsConsignee() {
        return isConsignee;
    }

    public void setIsConsignee(boolean isConsignee) {
        this.isConsignee = isConsignee;
    }

    //0 - true, 1 - false, null need to select in JSP
    public String getIsConsignmentSales() {
        return isConsignmentSales;
    }
    //0 - true, 1 - false, null need to select in JSP
    public void setIsConsignmentSales(String isConsignmentSales) {
        this.isConsignmentSales = isConsignmentSales;
    }

    public String getNewEndUserName() {
        return newEndUserName;
    }

    public void setNewEndUserName(String newEndUserName) {
        this.newEndUserName = newEndUserName;
    }

    public String getNewEndCustomerName() {
        return newEndCustomerName;
    }

    public void setNewEndCustomerName(String newEndCustomerName) {
        this.newEndCustomerName = newEndCustomerName;
    }

    public ArrayList getBillingAddresses() {
        return billingAddresses;
    }

    public void setBillingAddresses(ArrayList billingAddresses) {
        this.billingAddresses = billingAddresses;
    }

    public String getUserField1() {
        return userField1;
    }

    public void setUserField1(String userField1) {
        this.userField1 = userField1;
    }

    public String getUserField2() {
        return userField2;
    }

    public void setUserField2(String userField2) {
        this.userField2 = userField2;
    }
}